package com.lizba.tips.day4;

import java.sql.Timestamp;
import java.util.Date;

/**
 * <p>
 *    Java自带jdk equals方法的对称性测试
 * </p>
 *
 * @Author: Liziba
 * @Date: 2021/10/24 14:48
 */
public class EqualsDemo {


    public static void main(String[] args) {
        Date date = new Date();
        Timestamp timestamp = new Timestamp(date.getTime());
        System.out.println("Date equals to Timestamp: " + date.equals(timestamp));
        System.out.println("timestamp equals to Date: " + timestamp.equals(date));
    }

}
